<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>华泰信息化管理系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<#include "../public/css.ftl">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<#include "../public/tip.ftl">
<div class="wrapper">
<#include "../public/header.ftl">
    <!-- Left side column. contains the logo and sidebar -->
<#include "../public/aside.ftl">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Data Tables
                <small>指标管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
                <li class="active">项目评分</li>
                <li class="active">指标管理</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-6">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">指标类型</h3>
                        </div>
                        <div id="toolbar1">
                            <div class="form-inline" role="form">
                                <div class="form-group">
                                    <a class="btn btn-app " onclick="showAssetAdd()">
                                        <i class="fa fa-plus"></i> 新增指标类型
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="box-body">
                            <table id="batchTable" data-toggle="table" data-url="#"  data-toolbar="#toolbar1" data-query-params="queryParams" data-search="true"  data-pagination="true" data-sort-name="id" data-sort-order="desc">
                                <thead>
                                <tr>
                                    <th data-field="id">序号</th>
                                    <th data-field="taskName">编号</th>
                                    <th data-field="occurDate">名称</th>
                                    <th data-field="occurTime">系数</th>
                                    <th data-field="costTime">状态</th>
                                    <th data-field="costTime">操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                    <!-- /.box -->
                </div>

                <div class="col-md-6">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">指标值</h3>
                        </div>
                        <div id="toolbar2">
                            <div class="form-inline" role="form">
                                <div class="form-group">
                                    <a class="btn btn-app " onclick="showAssetAdd()">
                                        <i class="fa fa-plus"></i> 新增指标值
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="box-body">
                            <table id="batchTable" data-toggle="table" data-url="#"  data-toolbar="#toolbar2" data-query-params="queryParams" data-search="true"  data-pagination="true" data-sort-name="id" data-sort-order="desc">
                                <thead>
                                <tr>
                                    <th data-field="id">序号</th>
                                    <th data-field="taskName">编号</th>
                                    <th data-field="occurDate">指标类型</th>
                                    <th data-field="occurTime">指标值</th>
                                    <th data-field="costTime">分数</th>
                                    <th data-field="exeTimes">状态</th>
                                    <th data-field="costTime">操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
<#include "../public/footer.ftl" >
    <div class="control-sidebar-bg"></div>
</div>
<#include "../public/js.ftl" >
<script src="dist/js/datepicker/WdatePicker.js" language="javascript" type="text/javascript" ></script>
<script>

    function search(){
        $("#batchTable").bootstrapTable('refresh');
    }
    function queryParams(){
        return {
            occurDate:$("#occurDate").val()
        };
    }
    function dateFormatter(value, row, index){
        if(value == "" || value == undefined)
            return value;
        return value.substr(0,4)+"-"+value.substr(4,2)+"-"+value.substr(6,2);
    }
    function timeFormatter(value, row, index){
        if(value == "" || value == undefined)
            return value;
        return value.substr(0,2)+":"+value.substr(2,2)+":"+value.substr(4,2);
    }
    function dealStatusFormatter(value, row, index) {
        if(value == "W") {
            return "<span class=\"label label-primary\">等待执行</span>";
        } else if(value == "R") {
            return "<span class=\"label label-info\">正在执行</span>";
        } else if(value == "S") {
            return "<span class=\"label label-success\">执行成功</span>";
        } else if(value == "F") {
            return "<span class=\"label label-danger\">执行失败</span>";
        }
    }
    function returnMemoFormatter(value, row, index){
        if(value == "" || value == undefined)
            return value;
        if(value.length > 10) {
            return value.substr(0,10)+"<a href=\"javascript:void(0)\" onclick=\"showInfo('"+value+"')\"  \">......</a>" ;
        } else {
            return value;
        }
    }
    function showInfo(value){
        $("#bodyDiv").html(value);
        $("#myModal").modal("show");
    }
</script>
</body>
</html>
